import battlegui.*;
import java.util.ArrayList;
/**
 * The project "Strijd der Galliers" is a game where you need to burn down every house of the other
 * player.
 * 
 * This class makes a shed with a specified type of orientation and size.
 * 
 * @author Jonathan Smet & Mathieu Reymond 
 * @version 12.03.11
 */
public class Shed
{
    private int size;
    private Orientation shedOrientation;
    private Player shedOwner;
    private ArrayList<Boolean> shedParts;
    /**
     * Makes a Shed.
     * 
     * @param int The size of the shed
     * @param Orientation The orientation (vertical - horizontal) of the shed
     * @param Player The player that own this shed
     */
    public Shed(int size, Orientation shedOrientation, Player shedOwner)
    {
        this.size = size;
        this.shedOrientation = shedOrientation;
        this.shedOwner = shedOwner;
        shedParts = new ArrayList<Boolean>();
        
        for(int index = 0; index < size; index++)
        {
            shedParts.add(true);
        }
    }
    
    /**
     * Let you know the size of the shed
     * 
     * @return The shed's size
     */
    public int getSize()
    {
        return size;
    }
    public Player getshedOwner()
    {
        return shedOwner;
    }
    /**
     * Let you know the shed's orientation
     * 
     * @return The shed's orientation
     */
    public String getOrientation()
    {
        return shedOrientation.toString();
    }
    
    /**
     * This method will change the value of the shed's parts
     */
    public void changeShedParts()
    {
        if(shedParts.get(size-1) == true)
        {
            boolean index = true;
            int count = 0;
            while(index)
            {
                if(shedParts.get(count) == true)
                {   
                    shedParts.set(count, false);
                    index = false;
                }
                count++;
            }
        }
    }
    
    /**
     * This method will give you the value of the shed's parts
     * 
     * @return A list of all the parts of the shed
     */
    public ArrayList<Boolean> getShedParts()
    {
        return shedParts;
    }
}
